﻿using RAP.Framework.Libary.DataSource.Model.DataSource;
using RAP.Framework.Libary.DomTemplateBuilder.Element.Parameter;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace RAP.Framework.Libary.SqlTaskParser
{
  public interface ISqlPaserFactory
  {
    /// <summary>
    /// 
    /// </summary>
    /// <param name="sql"></param>
    /// <param name="defaultDataSourceId"></param>
    /// <param name="tokenRegex"></param>
    /// <param name="processingSqlToken"></param>
    /// <param name="processedSqlToken"></param>
    /// <returns></returns>
    SqlParseResult ParseSqlTasks(
      string sql,
      DataSourceConfig dataSourceConfig,
      string defaultDataSourceId = null,
      Regex tokenRegex = null,
      Func<SqlParseContext, bool> processingSqlToken = null,
      Func<SqlParseContext, bool> processedSqlToken = null);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="paramsSql"></param>
    /// <param name="parameterContext"></param>
    /// <returns></returns>
    string DebugSql(string paramsSql, ParameterCollection parameterContext, Regex debugRegex = null);
  }
}
